<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>20_正则表达式-单字修饰符</title>
    </head>
    <body>
        <script>
            var reg = /^\d{6,8}$/;
            console.log(reg.test('1233233'));
            console.log(reg.test('1233f233'));
            console.log(reg.test('12333233'));
            console.log(reg.test('123332332'));


            var reg = /^\w{6,8}$/;
            console.log(reg.test('a1_A2'));
            console.log(reg.test('a1_A2_'));
        </script>
    </body>
</html>